<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
  <head>
    <base href="<%=basePath%>" />
    
    <title>发送短信息</title>
    
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
	<meta http-equiv="description" content="This is my page" />
	<link rel="stylesheet" href="css/style.css" type="text/css"></link>
<script type="text/javascript">	
function validate(){
	if(valititle()==true && valicontent()==true && valiuserId()==true){	
		return true;
	}else{
		return false;
	}
}
function valiuserId(){
	var userId = document.getElementById("userId").value;
	var spId = document.getElementById("spId");
	if(userId == "" ){
		spId.innerHTML="<font color:red>× 收件人不能为空！</font>";
		return false;
	}else if(isNaN(userId)){
		spId.innerHTML="<font color:red>× 收件人编号只能为数字！</font>";
		document.getElementById("userId").focus();
		return false;
	}
	return true;
}
function valititle(){
	var title = document.getElementById("title").value;
	if(title == ""){
		alert("信件标题不能为空！");
		return false;
	}
	return true;
}
function valicontent(){
	var content = document.getElementById("content").value;
	if(content == ""){
		alert("信件内容不能为空！");
		return false;
	}
	return true;
}
</script>
</head>  
<body>
	<div class="topTitle">
  		<img src="images/main_28.gif"/>&nbsp;私人信件
  	</div>

  <form name="form1" method="post" action="doAddMessage">
    <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="table01">
      <tr>
        <td colspan="2" class="td_02" align="center">
        	<span class=td_title>消息发送</span>
        	 <input type="hidden" name="mess.employeeBySendId.userId" value="${employee.userId} "/> 
        </td>
      </tr>
      <tr>
        <td class="td_02">收件人<br /></td>
        <td class="td_08">
        <input name="mess.employeeByGetId.userId" id="userId" class="input" size="40px;" type="text" />
        <span id="spId" style="color:red">(请输入员工编号)${tishi}</span>
        </td>
      </tr>
      <tr>
        <td width="14%" class="td_02">信息标题</td>
        <td width="86%" class="td_02"><input name="mess.mesTitle" id="title" type="text" class="input" style="width:99% " /></td>
      </tr>
      <tr>
        <td class="td_02">信息内容</td>
        <td class="td_02"><textarea name="mess.content" id="content" rows="5" style="width:99% "></textarea>
        </td>
      </tr>
    </table><br />
    <table width="95%"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td class="td_page"><div align="center">
            <input name="Submit" type="submit" class="buttonface02" value="  发 送  " onclick="return validate()" />
&nbsp;&nbsp;
        <input name="Submit" type="reset" class="buttonface02" value="  重 置  " />
        </div></td>
      </tr>
    </table>
    <br />
  </form>
</body>
</html>
